package com.kerbores.jongo.marshall.nutz;

import java.lang.reflect.Field;

import com.kerbores.jongo.marshall.nutz.anno.Id;

/**
 * @author 王贵源<kerbores>
 *
 *         create at 2015年12月22日 上午10:39:50
 */
public interface IdFieldSelector {
	public boolean isId(Field f);

	public boolean isObjectId(Field f);

	public static IdFieldSelector defaultiIdFieldSelector = new IdFieldSelector() {

		@Override
		public boolean isObjectId(Field f) {
			return f.getAnnotation(Id.class) != null;
		}

		@Override
		public boolean isId(Field f) {
			return f.getAnnotation(Id.class) != null;
		}
	};
}
